UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VWy2hpVF3PpIBBdNgnpi8SNzt6q7LM22kZ1FodtZsJE='
WHERE
key_id = 'a74cb23b548401dda6a0bdf2c0d1e2df53b69a98f863b48bcee7376b72cb4860'
AND (
token = 'VWy2hpVF3PpIBBdNgnpi8SNzt6q7LM22kZ1FodtZsJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)