UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VInY0zJGJ8Y8srTJ+6eBfLewbcIsU0htfm60RDVWavE='
WHERE
key_id = 'fae3b7d7734a906a6fc643039150c92b041fc1dbb8866a9dc177db350cfa8cfa'
AND (
token = 'VInY0zJGJ8Y8srTJ+6eBfLewbcIsU0htfm60RDVWavE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)