UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ktibsvZ+DPu+nFRQBd3xJBrMPCWLyMXS1mJ6Fq9NhvQ='
WHERE
key_id = 'ab7f1c86ec08202f3626a7a6f241eacc11f73dd541959e26bbc23ad84c23b61d'
AND (
token = 'ktibsvZ+DPu+nFRQBd3xJBrMPCWLyMXS1mJ6Fq9NhvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)