UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I8S/oejpaXt+gNgrEuYjHw2N21O3aT6EJnQcoPabBk0='
WHERE
key_id = 'a60ff6d41f3259b37f07462b070af39c4022178ede894aa768af7c8fa2aaaed9'
AND (
token = 'I8S/oejpaXt+gNgrEuYjHw2N21O3aT6EJnQcoPabBk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)