UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4A+Kk66n3IzaFRP6ITQBjXx/RZzZgRv9a/oOAg2k8KY='
WHERE
key_id = 'a5c3a2b8220148041cd1e56fe65279fcf8c056dc3900aab3eca51178c5bc7cad'
AND (
token = '4A+Kk66n3IzaFRP6ITQBjXx/RZzZgRv9a/oOAg2k8KY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)