UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2IRarqh8DydpjDHkBcocR/Ly9NvfLZkbRH+0ogJfpZM='
WHERE
key_id = '9cf06cb48578bbb47dd561f6ea736b299800e3ff1c06bffc796f3f09f659595e'
AND (
token = '2IRarqh8DydpjDHkBcocR/Ly9NvfLZkbRH+0ogJfpZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)