UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hk1Bu99zZcIafZleWFunPpk/dBDYgPZsuFejuSapeSY='
WHERE
key_id = 'af0fbcf18c42c3911472c25950a92e55c1a46878e9e7198cfb693c92095620c2'
AND (
token = 'hk1Bu99zZcIafZleWFunPpk/dBDYgPZsuFejuSapeSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)