UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'McV0h2wo7hjt1xQ+vujwiBrCaTrRd+Clbd91eV2m7U4='
WHERE
key_id = '8df2fc4746ab99af4ed5585bbc3e00aebc1392f2592df12c5684cec0c1f91140'
AND (
token = 'McV0h2wo7hjt1xQ+vujwiBrCaTrRd+Clbd91eV2m7U4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)