UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3bv4IKk331zpQWoeHuL1qlNd0IuMkraBzFOBHcnPej0='
WHERE
key_id = '0b3bcd7bd5406ee6566f7f1ec59b785d263e92427822b446e434525bdf3f78a2'
AND (
token = '3bv4IKk331zpQWoeHuL1qlNd0IuMkraBzFOBHcnPej0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)