UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DoQC7Y4V+cNy6PYLqwIWMYYWWMyDhNu5CvO7hAkQsp4='
WHERE
key_id = '58d37e87ec4bc0918f6d0c7d3accaeef8f56f6f8b50ffed1eb5fbefc3168cc48'
AND (
token = 'DoQC7Y4V+cNy6PYLqwIWMYYWWMyDhNu5CvO7hAkQsp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)