UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't5z5jV9lhqgNRq2gqovjBHdULI5B4w3qutiN2G2FAP4=' 
WHERE 
  key_id = '3bc5c0603a9b20c97107c4c0b830fa7f1f8afbd4e9d8c0f36280686e707d44d1' 
  AND (
    token = 't5z5jV9lhqgNRq2gqovjBHdULI5B4w3qutiN2G2FAP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031