UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/4mXMt/GUK6qWlCXQB1C0RrfpOwbcYxdGBBa02ouXGQ=' 
WHERE 
  key_id = '23a270040a07a6991fa4cf9bbba0b050cde88a452c9df580d652808d4d4fb86a' 
  AND (
    token = '/4mXMt/GUK6qWlCXQB1C0RrfpOwbcYxdGBBa02ouXGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026