UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XooORasb/k0ZzylQ64wdueRqOQyop1Zckt4yBpR4+aE='
WHERE
key_id = '6c73134ff317b1b3a8dcf020e589076b0c204c2b42652dcd467b5b12e688111b'
AND (
token = 'XooORasb/k0ZzylQ64wdueRqOQyop1Zckt4yBpR4+aE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)