UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g3Cr1TMHI0++gVcBVAZf3yYSI3FUnGaV3JeKzuMqsjw='
WHERE
key_id = '43cbbbfa86801a399a77be03866ec332eeb3e84d30053254dd58422e0010978a'
AND (
token = 'g3Cr1TMHI0++gVcBVAZf3yYSI3FUnGaV3JeKzuMqsjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)