UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'olO9wGb3079E+Ohhus0+FYHgWUGDvu4QRivrZYgl3C4='
WHERE
key_id = '5bde95dfc3cf30f5ed69433612eef7e041820104bf1dd73c7472568675b793dd'
AND (
token = 'olO9wGb3079E+Ohhus0+FYHgWUGDvu4QRivrZYgl3C4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)