UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Veoj/5w4zwcj4TvXhyxjFwoHLT92ctTE22a4qLk4nbk='
WHERE
key_id = '0a45cc1940e1101be9d52e632b53543820f2c0b7ae26fe072dea0bef6d9b2a89'
AND (
token = 'Veoj/5w4zwcj4TvXhyxjFwoHLT92ctTE22a4qLk4nbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)