UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xoJmJskEVzHgmHkBPzXITZT0EL+XbjWss8KMJWum6yc='
WHERE
key_id = '1d45467ae95c89b3f5a4723cc3125ff321ce0ea4f69499cbc3252ff79a890648'
AND (
token = 'xoJmJskEVzHgmHkBPzXITZT0EL+XbjWss8KMJWum6yc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)