UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cz1HQDMpKBwLAtodCrQ4+g1qE6DLpIgbNp3J/W9WyC4='
WHERE
key_id = '715e9f18bd623e363142b87fa68f99dc27d7ecea2ed28c7139f24ced30bdb2f7'
AND (
token = 'Cz1HQDMpKBwLAtodCrQ4+g1qE6DLpIgbNp3J/W9WyC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)