UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y8b0SLI8abDAO/Eqf7mR1UXUuj75niojgbZ/2OCgFVc='
WHERE
key_id = '17e7e25ac1a926cdeca434561a665b676552871ef1e3950525a8a80cfa3f0beb'
AND (
token = 'y8b0SLI8abDAO/Eqf7mR1UXUuj75niojgbZ/2OCgFVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)