UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QL1FHbpPHdNXfcVu/0E/Jv90/A7QiaNQdssBRKx9Tpg='
WHERE
key_id = 'dad34dcb6381e08867699d5700515d8f2ed0e4ba9872ca53dfc8e386a27adb73'
AND (
token = 'QL1FHbpPHdNXfcVu/0E/Jv90/A7QiaNQdssBRKx9Tpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)