UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F3Xd7p4h/++mAw94abGnUKH2emWceQtwJN1/ZR73O5M='
WHERE
key_id = '33177947ef657371b114e5d35f6234e569982d7b6daeae2189e05c59482abf0a'
AND (
token = 'F3Xd7p4h/++mAw94abGnUKH2emWceQtwJN1/ZR73O5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)