UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'coomfr19h6/1y9rSKKehBmAZ7pL6QDHOyOmDx7EFlNY='
WHERE
key_id = 'd854291eafc7fbdd9cc21e9b077c2ad9d0988a878012222b1b938d49bd5856f9'
AND (
token = 'coomfr19h6/1y9rSKKehBmAZ7pL6QDHOyOmDx7EFlNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)