UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3N0VXnzsCVRZMVZvqbmF26Ew5buwUCJyalQezHm+NnE='
WHERE
key_id = 'f7537168c9cb9fe01dfca6b5c6dff23e70f4dc5f2c9476c568e20e33e4a12c69'
AND (
token = '3N0VXnzsCVRZMVZvqbmF26Ew5buwUCJyalQezHm+NnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)