UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0OJMjSPEFfw0+MRq7tKQZKxrK8WMEMyB6jQjj8kpsPo='
WHERE
key_id = 'c6e60d429dac7b02248b517b7926bc5d880e26de0b3ee2d07dd11a7486806b21'
AND (
token = '0OJMjSPEFfw0+MRq7tKQZKxrK8WMEMyB6jQjj8kpsPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)