UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8deAEUW6kTmIv/ihx3v4dQCpIGqyrJ4YA4MQuAIaFsA='
WHERE
key_id = '855c97cf622375baece0188832af4aeaec36b84e4c54d36b2e5b988dc4d4749e'
AND (
token = '8deAEUW6kTmIv/ihx3v4dQCpIGqyrJ4YA4MQuAIaFsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)