UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bDn9ZAPxkYLEgOBOtWGBe6Te8GCBOzEEIMrbWEgSCNk=' 
WHERE 
  key_id = '0918508cf13d04811184071f58f76f563891b540f878419a98c215443c5a593b' 
  AND (
    token = 'bDn9ZAPxkYLEgOBOtWGBe6Te8GCBOzEEIMrbWEgSCNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029