UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hoopwt85303qP5NO6vCWxIYyqlSxqUvqjasEGo3O3jU='
WHERE
key_id = '0e7e799b4b5e7a8d9e1daab79f17d01720d29edd363ae0d7f948543179263714'
AND (
token = 'hoopwt85303qP5NO6vCWxIYyqlSxqUvqjasEGo3O3jU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)