UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ULV+X985IjD4DJMTQPWBs6PA1ZiwPvVzD0n/O997O88='
WHERE
key_id = '73f9c09915816beb4845720588a91e7cf1232fdcc25381ebbed766c854ce7c39'
AND (
token = 'ULV+X985IjD4DJMTQPWBs6PA1ZiwPvVzD0n/O997O88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)