UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1aM/UHv/JTf8EH1zItZjtKI+MkisoELI9leWD4MFBxQ='
WHERE
key_id = '965b59fcda3a181aceb207110a0a097349bab5b382d8c3e93000f59b329853ce'
AND (
token = '1aM/UHv/JTf8EH1zItZjtKI+MkisoELI9leWD4MFBxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)