UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'flL9X1Ah326iYffeTV9yYV8jwkrqTmhTPWni8FWvfSU='
WHERE
key_id = '69e26d227919b3fb6f5285deb3e032977bf14f1408534f7f2600d4049153879e'
AND (
token = 'flL9X1Ah326iYffeTV9yYV8jwkrqTmhTPWni8FWvfSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)