UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mdtg0TIK+VmKhNmIVRHaBAEEgxb0agWy51nbdOTE66I='
WHERE
key_id = '70ee3f4d5f1ed437acee1d45951ee2c9836bdb628411879fe4f29ea1e7440caa'
AND (
token = 'mdtg0TIK+VmKhNmIVRHaBAEEgxb0agWy51nbdOTE66I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)