UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'deOWJ9uEDkBRYxP+oWEKuN6Uzd6sdZo15y+kHHyVyps='
WHERE
key_id = 'b82ed3f813ef888f48e529d1378d24b114a37e390b3921c79ccf9762cb747929'
AND (
token = 'deOWJ9uEDkBRYxP+oWEKuN6Uzd6sdZo15y+kHHyVyps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)