UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fANiP3GZpaztRkWjg5SJKBWl7BBjdOIUxBbpjnq8Frw=' 
WHERE 
  key_id = '884fc1fe02f0984ac9b67a085afd2587dd4f65f3775f409a321e54e29ec70a1b' 
  AND (
    token = 'fANiP3GZpaztRkWjg5SJKBWl7BBjdOIUxBbpjnq8Frw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028