UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vCy5DIMRzCaqMc384URk3nuCdrnoOXt9QZOHiPgzapw='
WHERE
key_id = '735205cd4021644ad044f3f43032c147cb9182e408a5a0371d877db33c0e40c5'
AND (
token = 'vCy5DIMRzCaqMc384URk3nuCdrnoOXt9QZOHiPgzapw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)