UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KUjAhlSJMnOllGXt3CkqZdcbReMq/KbofJEILmCamho='
WHERE
key_id = '8ef64937213768c2b32ef6c8ffd92b2e3107fc33300397445c463301ae2d4e7d'
AND (
token = 'KUjAhlSJMnOllGXt3CkqZdcbReMq/KbofJEILmCamho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)