UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GsDA1CX1R/hbSQdFWb2AjhiPrsSpOVu//HjlO3tVljw='
WHERE
key_id = '4fa9f24336a4bce95e7d665607c85d4b728fe9be609322fe44c5536082031023'
AND (
token = 'GsDA1CX1R/hbSQdFWb2AjhiPrsSpOVu//HjlO3tVljw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)