UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98bWWE7xtDMF834T3EHgzdzDAJ+gWwo0PpSKwMeF074='
WHERE
key_id = '8daed06684e650b024f65c272b88bd433a9a5f0007329c675b72dc34a3f4ab76'
AND (
token = '98bWWE7xtDMF834T3EHgzdzDAJ+gWwo0PpSKwMeF074='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)