UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IAcE/a2PY6+3skQ8t7FPWRu5yCjdSQprVHDXG++/RuM='
WHERE
key_id = 'f8f0b19970d9428104043efa0946d786384d97c98a781d4c5afd3aeca5e2bd4d'
AND (
token = 'IAcE/a2PY6+3skQ8t7FPWRu5yCjdSQprVHDXG++/RuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)