UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qo3e6mPE71GEwNXnkbgwD2tQPwHviavqeJJIaLKrewU='
WHERE
key_id = '6df4e5f15dd23553cd04409e8c4f3c405ae93ff2e6664eadbb6282f0be5a39e7'
AND (
token = 'Qo3e6mPE71GEwNXnkbgwD2tQPwHviavqeJJIaLKrewU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)