UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7z8M/qWwiBRFxS1Mlc6N240tySPxeKwj6TBuE2njBLY='
WHERE
key_id = '81122d87514c9f32d2cf11e644f57fbfcd1d09f612128ec352c619bc41632c3a'
AND (
token = '7z8M/qWwiBRFxS1Mlc6N240tySPxeKwj6TBuE2njBLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)