UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9/D8H7OGB5QsuuBe6tncAQF4WXxnGaWR8eQIFfKK3o8='
WHERE
key_id = 'a1693969377eed5a8f258bc65949f88ad78dcd38370e1e52e72e12f74b0bff77'
AND (
token = '9/D8H7OGB5QsuuBe6tncAQF4WXxnGaWR8eQIFfKK3o8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)