UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TqUjyeI9hUQ1sPRP7yLzSVmgPD5UUFO39VciqJyrfZU=' 
WHERE 
  key_id = '0eadc4be253816b48b5ecc78cd03730a9db21ba7b1c4eb92fb90cac22eada152' 
  AND (
    token = 'TqUjyeI9hUQ1sPRP7yLzSVmgPD5UUFO39VciqJyrfZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036