UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IPJEFMastSWk6jHwBmCfojCZu5derUBUe/zK5VSyX1Y='
WHERE
key_id = '2b0b88907e105c3d29a3e749fba3bb357f37992559f866d7cc417cebfb8bb8b3'
AND (
token = 'IPJEFMastSWk6jHwBmCfojCZu5derUBUe/zK5VSyX1Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)