UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'awbx4Krj4Icr1a/xRcK0Hvof2rkkS4iLyEOUD4c8voU='
WHERE
key_id = '74c24440944915efe24e786e35275a9af32b61dc8c1cf864bd0d0a9725cd3fa7'
AND (
token = 'awbx4Krj4Icr1a/xRcK0Hvof2rkkS4iLyEOUD4c8voU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)