UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/0tA9EKjabUbiQJsIbpMJlPor7rsoj7yJfGZRrmffxI='
WHERE
key_id = '651db76f025897f4b7fc4fd631e2dab5f428de1a9878c45ea64f1b55ebf779eb'
AND (
token = '/0tA9EKjabUbiQJsIbpMJlPor7rsoj7yJfGZRrmffxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)