UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+lNxTrlPusGqPbHnSsc970YR2X63O0VZWACBS1gH+dk='
WHERE
key_id = '8dee1b543ad1faccb189665ab7a0c40364654a275b54cfb23bbe7bb6e11ce65d'
AND (
token = '+lNxTrlPusGqPbHnSsc970YR2X63O0VZWACBS1gH+dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)